home *** CD-ROM | disk | FTP | other *** search
- /*
- * Useful utilities for INTERNAT
- *
- * William S. Hall
- * 3665 Benton Street, #66
- * Santa Clara, CA 95051
- *
- */
-
- #define NOCOMM
- #define NOKANJI
- #define NOSOUND
- #include <windows.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include "winutils.h"
-
- /*
- * This function replaces printf.
- * To see the results on the secondary monitor use OX.SYS
- * Do NOT run Windows with redirection to AUX.
- * Use dbs just like printf
- * Example dbs("function foo %d %s, myint, mystring);
- */
- void FAR _cdecl dbs(const char *fmt, ...)
- {
- char buf[255];
-
- va_list arg_ptr;
-
- va_start(arg_ptr, fmt);
- vsprintf(buf, fmt, arg_ptr);
- va_end(arg_ptr);
-
- OutputDebugString(buf);
-
- }
-
- /* Show a modal dialog box */
- int FAR OpenDlgBox(HWND hWnd, FARPROC fpProc, WORD boxnum, HANDLE hRC)
- {
-
- FARPROC fp;
- int result;
- HANDLE hInst = GetWindowWord(hWnd, GWW_HINSTANCE);
-
- /* make a proc instance for the about box window function */
- fp = MakeProcInstance(fpProc, hInst);
- /* create a modal dialog box */
- result = DialogBox(hRC, MAKEINTRESOURCE(boxnum),hWnd,fp);
- FreeProcInstance(fp);
- return result;
-
- }
-
- /* Show a modal dialog box with parameters */
- int FAR OpenDlgBoxParam(HWND hWnd, FARPROC fpProc, WORD boxnum,
- HANDLE hRC, LONG lParam)
- {
-
- FARPROC fp;
- int result;
- HANDLE hInst = GetWindowWord(hWnd, GWW_HINSTANCE);
-
- /* make a proc instance for the about box window function */
- fp = MakeProcInstance(fpProc, hInst);
- /* create a modal dialog box */
- result = DialogBoxParam(hRC, MAKEINTRESOURCE(boxnum),hWnd,fp,lParam);
- FreeProcInstance(fp);
- return result;
-
- }
-
-